var Fly=require("flyio");
var fly=new Fly
fly.config.baseURL = "https://cnodejs.org";

fly.interceptors.request.use((request)=>{
  //给所有请求添加自定义header
  // request.headers["X-Tag"]="flyio";
  wx.showLoading({
    title: '加载中',
  })
  return request;
})
fly.interceptors.response.use(
  (response) => {
      //只将请求结果的data字段返回
      wx.hideLoading()
      return response.data
  },
  (err) => {
      //发生网络错误后会走到这里
      //return Promise.resolve("ssss")
  }
)
export default fly;

